<template>
<div class="concent">
    <h2>当前计数：{{ modelvalue }}</h2>
    <button @click="changecounter">修改值</button>
</div>
</template>
<script>

export default {
    // 父传子
    props: {
        modelvalue: {
            type: Number,
            default:0
        }
    },
    // 子传父
    emits: ["update:modelvalue"],
    methods: {
        changecounter() {
            this.$emit("update:modelvalue",9999)
        }
    }
}
</script>
<style scoped lang="less">

</style>
